import csv

with open("data.csv", "r", encoding="UTF-8") as f:
    cf = csv.reader(f)
    next(cf)  # 跳过头信息
    next(cf)  # 跳过头信息
    list_score = list()
    for i in cf:
        if len(i) > 2:  # 确保这一行至少有三个元素
            score = int(i[2])
            print(score)
            list_score.append(score)
    if list_score:  # 确保列表不为空
        print(sum(list_score) / len(list_score))

'''
with open("data.csv", "a", encoding="UTF-8") as f:
    cf = csv.writer(f)
    cf.writerow(["tom", "c++", 30])
    list_write = [["tom", "c++", 30], ["tom", "c++", 30], ["tom", "c++", 30]]  # 二维列表
    cf.writerows(list_write)

'''
